import numpy as np
arr = np.random.rand(2,3,4)
print(arr)

# transpose：调整轴顺序为 (2,1,0)
print('*' * 35)
transposed = arr.transpose(2,1,0)
print(transposed)

# swapaxes：仅交换轴0和轴2
print('*' * 35)
swapped = arr.swapaxes(0,2)
print(swapped)